package domain;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by liukx on 2018-07-24.
 */
public abstract class Animal {

    protected static final int N = 10; //n*n的网格

    protected static final int UP = 0;
    protected static final int DOWN = 1;
    protected static final int LEFT = 2;
    protected static final int RIGHT = 3;

    protected Map<String,Animal> coordinate = new HashMap<String, Animal>();//移动后的坐标

    protected String name;
    protected int x;
    protected int y;
    protected int lifeTime;//存活时间
    protected String type;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getLifeTime() {
        return lifeTime;
    }

    public void setLifeTime(int lifeTime) {
        this.lifeTime = lifeTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void eat(){
        System.out.println(this.getType()+this.getName()+"在吃!");
    }

    abstract void move();

    abstract void breed();

    abstract void dead();

}
